package com.kedacom.demo.cometd;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * (用一句话描述类的主要功能)
 * @author huangchunhua
 * @date 2016年4月25日
 */
@Component
public class CometdMessageSender {

	private static final String message_format = "test cometd message %04d";

	@Scheduled(cron = "*/5 * * * * ?")
	public void sendMessage() {
		for (int i = 0; i < 5; i++) {
			CometdJavaClient.sendMessage("/demo", String.format(message_format, i));
		}
	}

}
